import $getScript from './getScript'
import $env from '../model/env'

function loadVConsole () {
	const url = '//s.yangshipin.cn/CCTVVideo/CCTVVideoAssets/v1/js/vconsole.min.js'
	$getScript({
		src: url,
		onLoad () {
			if (window.VConsole && !window.vConsole) {
				window.vConsole = new window.VConsole()
			}
		}
	})
}

if ($env.enableVconsole) {
	loadVConsole()
}

export default loadVConsole
